Getting Ready: The ATM System

Understand the ATM design problem and learn the questions to simplify this problem further.

Problem definition#

An Automated teller machine (ATM) allows a bank customer to perform financial transactions remotely without the need for a teller or a bank branch. These transactions include deposits, withdrawals, balance inquiries, and account transfers. ATMs are located in convenient locations such as banks, grocery stores, airports, and other public places.

To use an ATM, users need a bank card associated with an account at a financial institution to use an ATM. To access their account, users must also know the personal identification number (PIN). The user can follow the prompts on the ATM's screen to complete the desired transaction with the PIN.

Created with Fabric.js 3.6.6
The user inserts their card in the ATM

1 of 18

Created with Fabric.js 3.6.6
The ATM reads the information on the card and prompts the user to enter their PIN

2 of 18

Created with Fabric.js 3.6.6
The options above appear on the ATM upon successful PIN authentication

3 of 18

Created with Fabric.js 3.6.6
The user selects the "Balance Inquiry" option

4 of 18

Created with Fabric.js 3.6.6
The ATM asks the user to collect the card

5 of 18

Created with Fabric.js 3.6.6
The ATM asks the user to collect the balance receipt

6 of 18

Created with Fabric.js 3.6.6
The options above appear on the ATM upon successful PIN authentication

7 of 18

Created with Fabric.js 3.6.6
The user selects the "Cash Withdrawal" option

8 of 18

Created with Fabric.js 3.6.6
The user selects the "$100" option

9 of 18

Created with Fabric.js 3.6.6
The ATM asks the user to collect the card

10 of 18

Created with Fabric.js 3.6.6
The ATM asks the user to collect the cash according to the amount specified

11 of 18

Created with Fabric.js 3.6.6
The ATM asks the user to collect the receipt

12 of 18

Created with Fabric.js 3.6.6
The options that appear on the ATM upon successful PIN authentication

13 of 18

Created with Fabric.js 3.6.6
The user selects the "Transfer Money" option

14 of 18

Created with Fabric.js 3.6.6
The ATM prompts the user to enter the receiver account number and the amount to be sent

15 of 18

Created with Fabric.js 3.6.6
The ATM notifies the user that the transaction was successful

16 of 18

Created with Fabric.js 3.6.6
The ATM asks the user to collect the card

17 of 18

Created with Fabric.js 3.6.6
The ATM asks the user to collect the receipt

18 of 18

Expectations from the interviewee#

There are several components in an ATM design, each with specific constraints and requirements. The following provides an overview of some of the main expectations that the interviewer will want to hear you discuss in more detail, during the interview.

ATM components #

To better understand an ATM system, you may ask the interviewer the following questions:

  1. What are the components of an ATM?

  2. Is the ATM necessarily placed inside a room?

  3. Does an ATM have a fingerprint scanner?

ATM features#

Different ATMs may vary in terms of features which is why it is important to clear the following questions from the interviewer:

  1. What is the withdrawal limit of an ATM?

  2. Can we check our account balance using an ATM?

  3. Can we set a PIN using an ATM?

ATM processing#

The interviewer would expect you to ask a question regarding the processing of transactions using an ATM. Therefore, you may ask the following questions:

  1. What happens when the amount entered by the user for withdrawal is greater than the user's account balance?

  2. What happens when the amount entered by the user for withdrawal is greater than the ATM's cash limit?

  3. What happens when the amount entered by the user exceeds the total cash present in the ATM?

  4. Can the ATM be used for online transactions?

Design approach#

We are going to design this ATM system using the bottom-up design approach. For this purpose, we will follow the steps below:

  • Identify and design the smallest components first—the screen, keypad, cash dispenser, printer, and card reader.

  • Use these small components to design bigger ATM components—the state, machine, and room.

  • Repeat the steps above until we design the whole ATM system.

Design pattern #

During an interview, it is always a good practice to discuss the design patterns that a parking lot system falls under. Stating the design patterns gives the interviewer a positive impression and shows that the interviewee is well-versed in the advanced concepts of object-oriented design.

Try to answer the following question. If you are not familiar with design patterns, don’t worry! You can learn about them by asking questions like, “Define design patterns.”

Which design pattern(s) should be used to design an ATM system? Please elaborate on your choice(s).

Please enter the correct design pattern(s)



Let’s explore the requirements of the ATM system in the next lesson.

Code for the Car Rental System

Requirements for the ATM System